package com.data.modules.online.cgform.converter.p010b;

import com.data.common.constant.ProvinceCityArea;
import com.data.common.util.SpringContextUtils;
import com.data.common.util.ConvertUtils;
import com.data.modules.online.cgform.converter.p009a.ForeseeConvert;
import com.data.modules.online.cgform.entity.OnlCgformField;

public class PcaConverter extends ForeseeConvert {

    ProvinceCityArea f128c = ((ProvinceCityArea) SpringContextUtils.getBean(ProvinceCityArea.class));

    public PcaConverter(OnlCgformField onlCgformField) {
        this.f122a = onlCgformField.getDbFieldName();
    }

    @Override
    public String converterToVal(String txt) {
        if (ConvertUtils.isEmpty(txt)) {
            return null;
        }
        return this.f128c.getCode(txt);
    }

    @Override
    public String converterToTxt(String val) {
        if (ConvertUtils.isEmpty(val)) {
            return null;
        }
        return this.f128c.getText(val);
    }
}
